ViewCompat

open class ViewCompat(source)

Helper for accessing features in View.

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Interface definition for a callback to be invoked when a hardware key event hasn't been handled by the view hierarchy.
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
Live region mode specifying that accessibility services should interrupt ongoing speech to immediately announce changes to this view.
Link copied to clipboard
Live region mode specifying that accessibility services should not automatically announce changes to this view.
Link copied to clipboard
Live region mode specifying that accessibility services should announce changes to this view.
Link copied to clipboard
Automatically determine whether a view is important for accessibility.
Link copied to clipboard
The view is not important for accessibility.
The view is not important for accessibility, nor are any of its descendant views.
Link copied to clipboard
The view is important for accessibility.
Link copied to clipboard
Automatically determine whether a view is important for content capture.
Link copied to clipboard
The view is not important for content capture, but its children (if any) will be traversed.
The view is not important for content capture, and its children (if any) will not be traversed.
Link copied to clipboard
The view is important for content capture, and its children (if any) will be traversed.
The view is important for content capture, but its children (if any) will not be traversed.
Link copied to clipboard
Indicates that the view has a hardware layer.
Link copied to clipboard
Indicates that the view does not have a layer.
Link copied to clipboard
Indicates that the view has a software layer.
Link copied to clipboard
Horizontal layout direction of this view is inherited from its parent.
Link copied to clipboard
Horizontal layout direction of this view is from deduced from the default language script for the locale.
Link copied to clipboard
Horizontal layout direction of this view is from Left to Right.
Link copied to clipboard
Horizontal layout direction of this view is from Right to Left.
Link copied to clipboard
Bit shift of MEASURED_STATE_MASK to get to the height bits for functions that combine both width and height into a single int, such as getMeasuredState and the childState argument of resolveSizeAndState.
Link copied to clipboard
val MEASURED_SIZE_MASK: Int = 16777215
Bits of getMeasuredWidthAndState and getMeasuredWidthAndState that provide the actual measured size.
Link copied to clipboard
val MEASURED_STATE_MASK: Int = -16777216
Bits of getMeasuredWidthAndState and getMeasuredWidthAndState that provide the additional state bits.
Link copied to clipboard
Bit of getMeasuredWidthAndState and getMeasuredWidthAndState that indicates the measured size is smaller that the space the view would like to have.
Link copied to clipboard
Always allow a user to over-scroll this view, provided it is a view that can scroll.
Link copied to clipboard
Allow a user to over-scroll this view only if the content is large enough to meaningfully scroll, provided it is a view that can scroll.
Link copied to clipboard
Never allow a user to over-scroll this view.
Link copied to clipboard
Indicates scrolling along the horizontal axis.
Link copied to clipboard
Indicates no axis of view scrolling.
Link copied to clipboard
Indicates scrolling along the vertical axis.
Link copied to clipboard
Scroll indicator direction for the bottom edge of the view.
Link copied to clipboard
Scroll indicator direction for the ending edge of the view.
Link copied to clipboard
Scroll indicator direction for the left edge of the view.
Link copied to clipboard
Scroll indicator direction for the right edge of the view.
Link copied to clipboard
Scroll indicator direction for the starting edge of the view.
Link copied to clipboard
Scroll indicator direction for the top edge of the view.
Link copied to clipboard
Indicates that the input type for the gesture is caused by something which is not a user touching a screen.
Link copied to clipboard
val TYPE_TOUCH: Int = 0
Indicates that the input type for the gesture is from a user touching the screen.

Functions

Link copied to clipboard
open fun addAccessibilityAction(@NonNull view: @NonNull View, @NonNull label: @NonNull CharSequence, @NonNull command: @NonNull AccessibilityViewCommand): Int
Adds an accessibility action that can be performed on a node associated with a view.
Link copied to clipboard
open fun addKeyboardNavigationClusters(@NonNull view: @NonNull View, @NonNull views: @NonNull Collection<View>, direction: Int)
Adds any keyboard navigation cluster roots that are descendants of view ( including view if it is a cluster root itself) to views.
Link copied to clipboard
open fun addOnUnhandledKeyEventListener(@NonNull view: @NonNull View, @NonNull listener: @NonNull ViewCompat.OnUnhandledKeyEventListenerCompat)
Adds a listener which will receive unhandled KeyEvents.
Link copied to clipboard
open fun addOverlayView(@NonNull overlayHost: @NonNull ViewGroup, @NonNull overlay: @NonNull View)
Convenience method to add overlay to overlayHost's overlay and assign the disjointParent in the overlay hierarchy.
Link copied to clipboard
@NonNull
open fun animate(@NonNull view: @NonNull View): @NonNull ViewPropertyAnimatorCompat
This method returns a ViewPropertyAnimator object, which can be used to animate specific properties on this View.
Link copied to clipboard
open fun cancelDragAndDrop(@NonNull v: @NonNull View)
Cancel the drag and drop operation.
Link copied to clipboard
open fun canScrollHorizontally(view: View, direction: Int): Boolean
Check if this view can be scrolled horizontally in a certain direction.
Link copied to clipboard
open fun canScrollVertically(view: View, direction: Int): Boolean
Check if this view can be scrolled vertically in a certain direction.
Link copied to clipboard
open fun combineMeasuredStates(curState: Int, newState: Int): Int
Merge two states as returned by getMeasuredState.
Link copied to clipboard
@NonNull
open fun computeSystemWindowInsets(@NonNull view: @NonNull View, @NonNull insets: @NonNull WindowInsetsCompat, @NonNull outLocalInsets: @NonNull Rect): @NonNull WindowInsetsCompat
Compute insets that should be consumed by this view and the ones that should propagate to those under it.
Link copied to clipboard
@NonNull
open fun dispatchApplyWindowInsets(@NonNull view: @NonNull View, @NonNull insets: @NonNull WindowInsetsCompat): @NonNull WindowInsetsCompat
Request to apply the given window insets to this view or another view in its subtree.
Link copied to clipboard
open fun dispatchFinishTemporaryDetach(@NonNull view: @NonNull View)
Notify a view that its temporary detach has ended; the view is now reattached.
Link copied to clipboard
open fun dispatchNestedFling(@NonNull view: @NonNull View, velocityX: Float, velocityY: Float, consumed: Boolean): Boolean
Dispatch a fling to a nested scrolling parent.
Link copied to clipboard
open fun dispatchNestedPreFling(@NonNull view: @NonNull View, velocityX: Float, velocityY: Float): Boolean
Dispatch a fling to a nested scrolling parent before it is processed by this view.
Link copied to clipboard
open fun dispatchNestedPreScroll(@NonNull view: @NonNull View, dx: Int, dy: Int, consumed: @Nullable Array<Int>, offsetInWindow: @Nullable Array<Int>): Boolean
open fun dispatchNestedPreScroll(@NonNull view: @NonNull View, dx: Int, dy: Int, consumed: @Nullable Array<Int>, offsetInWindow: @Nullable Array<Int>, type: Int): Boolean
Dispatch one step of a nested scroll in progress before this view consumes any portion of it.
Link copied to clipboard
open fun dispatchNestedScroll(@NonNull view: @NonNull View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, offsetInWindow: @Nullable Array<Int>): Boolean
open fun dispatchNestedScroll(@NonNull view: @NonNull View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, offsetInWindow: @Nullable Array<Int>, type: Int): Boolean
open fun dispatchNestedScroll(@NonNull view: @NonNull View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, offsetInWindow: @Nullable Array<Int>, type: Int, consumed: @NonNull Array<Int>)
Dispatch one step of a nested scroll in progress.
Link copied to clipboard
open fun dispatchStartTemporaryDetach(@NonNull view: @NonNull View)
Notify a view that it is being temporarily detached.
Link copied to clipboard
open fun enableAccessibleClickableSpanSupport(@NonNull view: @NonNull View)
Allow accessibility services to find and activate clickable spans in the application.
Link copied to clipboard
open fun generateViewId(): Int
Generate a value suitable for use in setId.
Link copied to clipboard
@Nullable
open fun getAccessibilityDelegate(@NonNull view: @NonNull View): @Nullable AccessibilityDelegateCompat
Get the current accessibility delegate.
Link copied to clipboard
open fun getAccessibilityLiveRegion(@NonNull view: @NonNull View): Int
Gets the live region mode for the specified View.
Link copied to clipboard
@Nullable
open fun getAccessibilityNodeProvider(@NonNull view: @NonNull View): @Nullable AccessibilityNodeProviderCompat
Gets the provider for managing a virtual view hierarchy rooted at this View and reported to android.accessibilityservice.AccessibilityServices that explore the window content.
Link copied to clipboard
@Nullable
open fun getAccessibilityPaneTitle(@NonNull view: @NonNull View): @Nullable CharSequence
Get the title of the pane for purposes of accessibility.
Link copied to clipboard
open fun getAlpha(view: View): Float
The opacity of the view.
Link copied to clipboard
@Nullable
open fun getAutofillId(@NonNull v: @NonNull View): @Nullable AutofillIdCompat
Gets the unique, logical identifier of this view in the activity, for autofill purposes.
Link copied to clipboard
@Nullable
open fun getBackgroundTintList(@NonNull view: @NonNull View): @Nullable ColorStateList
Return the tint applied to the background drawable, if specified.
Link copied to clipboard
open fun getBackgroundTintMode(@NonNull view: @NonNull View): @Nullable PorterDuff.Mode
Return the blending mode used to apply the tint to the background drawable, if specified.
Link copied to clipboard
@Nullable
open fun getClipBounds(@NonNull view: @NonNull View): @Nullable Rect
Returns a copy of the current setClipBounds.
Link copied to clipboard
@Nullable
open fun getContentCaptureSession(@NonNull v: @NonNull View): @Nullable ContentCaptureSessionCompat
Gets the session used to notify content capture events.
Link copied to clipboard
@Nullable
open fun getDisplay(@NonNull view: @NonNull View): @Nullable Display
Gets the logical display to which the view's window has been attached.
Link copied to clipboard
open fun getElevation(@NonNull view: @NonNull View): Float
The base elevation of this view relative to its parent, in pixels.
Link copied to clipboard
open fun getFitsSystemWindows(@NonNull view: @NonNull View): Boolean
Returns true if this view should adapt to fit system window insets.
Link copied to clipboard
open fun getImportantForAccessibility(@NonNull view: @NonNull View): Int
Gets the mode for determining whether this View is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen.
Link copied to clipboard
open fun getImportantForAutofill(@NonNull v: @NonNull View): Int
Gets the mode for determining whether this view is important for autofill.
Link copied to clipboard
open fun getImportantForContentCapture(@NonNull v: @NonNull View): Int
Gets the mode for determining whether this view is important for content capture.
Link copied to clipboard
open fun getLabelFor(@NonNull view: @NonNull View): Int
Gets the id of a view for which a given view serves as a label for accessibility purposes.
Link copied to clipboard
open fun getLayerType(view: View): Int
Indicates what type of layer is currently associated with this view.
Link copied to clipboard
open fun getLayoutDirection(@NonNull view: @NonNull View): Int
Returns the resolved layout direction for this view.
Link copied to clipboard
@Nullable
open fun getMatrix(view: View): @Nullable Matrix
The transform matrix of this view, which is calculated based on the current rotation, scale, and pivot properties.
Link copied to clipboard
Return the full height measurement information for this view as computed by the most recent call to measure.
Link copied to clipboard
open fun getMeasuredState(view: View): Int
Return only the state bits of getMeasuredWidthAndState and getMeasuredHeightAndState, combined into one integer.
Link copied to clipboard
Return the full width measurement information for this view as computed by the most recent call to measure.
Link copied to clipboard
open fun getMinimumHeight(@NonNull view: @NonNull View): Int
Returns the minimum height of the view.
Link copied to clipboard
open fun getMinimumWidth(@NonNull view: @NonNull View): Int
Returns the minimum width of the view.
Link copied to clipboard
open fun getNextClusterForwardId(@NonNull view: @NonNull View): Int
Gets the ID of the next keyboard navigation cluster root.
Link copied to clipboard
open fun getOnReceiveContentMimeTypes(@NonNull view: @NonNull View): @Nullable Array<String>
Returns the MIME types accepted by the listener configured on the given view via setOnReceiveContentListener.
Link copied to clipboard
open fun getOverScrollMode(view: View): Int
Returns the over-scroll mode for this view.
Link copied to clipboard
open fun getPaddingEnd(@NonNull view: @NonNull View): Int
Returns the end padding of the specified view depending on its resolved layout direction.
Link copied to clipboard
open fun getPaddingStart(@NonNull view: @NonNull View): Int
Returns the start padding of the specified view depending on its resolved layout direction.
Link copied to clipboard
@Nullable
open fun getParentForAccessibility(@NonNull view: @NonNull View): @Nullable ViewParent
Gets the parent for accessibility purposes.
Link copied to clipboard
open fun getPivotX(view: View): Float
The x location of the point around which the view is rotated and scaled.
Link copied to clipboard
open fun getPivotY(view: View): Float
The y location of the point around which the view is rotated and scaled.
Link copied to clipboard
@Nullable
open fun getRootWindowInsets(@NonNull view: @NonNull View): @Nullable WindowInsetsCompat
Provide original WindowInsetsCompat that are dispatched to the view hierarchy.
Link copied to clipboard
open fun getRotation(view: View): Float
Link copied to clipboard
open fun getRotationX(view: View): Float
Link copied to clipboard
open fun getRotationY(view: View): Float
Link copied to clipboard
open fun getScaleX(view: View): Float
Link copied to clipboard
open fun getScaleY(view: View): Float
Link copied to clipboard
open fun getScrollIndicators(@NonNull view: @NonNull View): Int
Returns a bitmask representing the enabled scroll indicators.
Link copied to clipboard
@Nullable
open fun getStateDescription(@NonNull view: @NonNull View): @Nullable CharSequence
Returns the View's state description.
Link copied to clipboard
@NonNull
open fun getSystemGestureExclusionRects(@NonNull view: @NonNull View): @NonNull List<Rect>
Retrieve the list of areas within this view's post-layout coordinate space where the system should not intercept touch or other pointing device gestures.
Link copied to clipboard
@Nullable
open fun getTransitionName(@NonNull view: @NonNull View): @Nullable String
Returns the name of the View to be used to identify Views in Transitions.
Link copied to clipboard
open fun getTranslationX(view: View): Float
The horizontal location of this view relative to its left position.
Link copied to clipboard
open fun getTranslationY(view: View): Float
The vertical location of this view relative to its top position.
Link copied to clipboard
open fun getTranslationZ(@NonNull view: @NonNull View): Float
The depth location of this view relative to its elevation.
Link copied to clipboard
@Nullable
open fun getWindowInsetsController(@NonNull view: @NonNull View): @Nullable WindowInsetsControllerCompat
Retrieves a WindowInsetsControllerCompat of the window this view is attached to.
Link copied to clipboard
open fun getWindowSystemUiVisibility(@NonNull view: @NonNull View): Int
Returns the current system UI visibility that is currently set for the entire window.
Link copied to clipboard
open fun getX(view: View): Float
Link copied to clipboard
open fun getY(view: View): Float
Link copied to clipboard
open fun getZ(@NonNull view: @NonNull View): Float
The visual z position of this view, in pixels.
Link copied to clipboard
open fun hasAccessibilityDelegate(@NonNull view: @NonNull View): Boolean
Checks whether provided View has an accessibility delegate attached to it.
Link copied to clipboard
open fun hasExplicitFocusable(@NonNull view: @NonNull View): Boolean
Returns true if this view is focusable or if it contains a reachable View for which hasExplicitFocusable returns true.
Link copied to clipboard
open fun hasNestedScrollingParent(@NonNull view: @NonNull View): Boolean
open fun hasNestedScrollingParent(@NonNull view: @NonNull View, type: Int): Boolean
Returns true if this view has a nested scrolling parent.
Link copied to clipboard
open fun hasOnClickListeners(@NonNull view: @NonNull View): Boolean
Returns whether the provided view has an attached View.OnClickListener.
Link copied to clipboard
open fun hasOverlappingRendering(@NonNull view: @NonNull View): Boolean
Returns whether this View has content which overlaps.
Link copied to clipboard
open fun hasTransientState(@NonNull view: @NonNull View): Boolean
Indicates whether the view is currently tracking transient state that the app should not need to concern itself with saving and restoring, but that the framework should take special note to preserve when possible.
Link copied to clipboard
open fun isAccessibilityHeading(@NonNull view: @NonNull View): Boolean
Gets whether this view is a heading for accessibility purposes.
Link copied to clipboard
open fun isAttachedToWindow(@NonNull view: @NonNull View): Boolean
Returns true if the provided view is currently attached to a window.
Link copied to clipboard
open fun isFocusedByDefault(@NonNull view: @NonNull View): Boolean
Returns whether view should receive focus when the focus is restored for the view hierarchy containing it.
Link copied to clipboard
open fun isImportantForAccessibility(@NonNull view: @NonNull View): Boolean
Computes whether this view should be exposed for accessibility.
Link copied to clipboard
open fun isImportantForAutofill(@NonNull v: @NonNull View): Boolean
Hints the Android System whether the android.app.assist.AssistStructure.ViewNode associated with this view is considered important for autofill purposes.
Link copied to clipboard
open fun isImportantForContentCapture(@NonNull v: @NonNull View): Boolean
Hints the Android System whether this view is considered important for content capture, based on the value explicitly set by setImportantForContentCapture and heuristics when it's IMPORTANT_FOR_CONTENT_CAPTURE_AUTO.
Link copied to clipboard
open fun isInLayout(@NonNull view: @NonNull View): Boolean
Returns whether the view hierarchy is currently undergoing a layout pass.
Link copied to clipboard
open fun isKeyboardNavigationCluster(@NonNull view: @NonNull View): Boolean
Returns whether view is a root of a keyboard navigation cluster.
Link copied to clipboard
open fun isLaidOut(@NonNull view: @NonNull View): Boolean
Returns true if view has been through at least one layout since it was last attached to or detached from a window.
Link copied to clipboard
open fun isLayoutDirectionResolved(@NonNull view: @NonNull View): Boolean
Returns whether layout direction has been resolved.
Link copied to clipboard
open fun isNestedScrollingEnabled(@NonNull view: @NonNull View): Boolean
Returns true if nested scrolling is enabled for this view.
Link copied to clipboard
open fun isOpaque(view: View): Boolean
Indicates whether this View is opaque.
Link copied to clipboard
open fun isPaddingRelative(@NonNull view: @NonNull View): Boolean
Return if the padding as been set through relative values View.setPaddingRelative(int, int, int, int) or thru
Link copied to clipboard
open fun isScreenReaderFocusable(@NonNull view: @NonNull View): Boolean
Returns whether the view should be treated as a focusable unit by screen reader accessibility tools.
Link copied to clipboard
On API 11 devices and above, call Drawable.jumpToCurrentState() on all Drawable objects associated with this view.
Link copied to clipboard
@Nullable
open fun keyboardNavigationClusterSearch(@NonNull view: @NonNull View, @Nullable currentCluster: @Nullable View, direction: Int): @Nullable View
Find the nearest keyboard navigation cluster in the specified direction.
Link copied to clipboard
open fun offsetLeftAndRight(@NonNull view: @NonNull View, offset: Int)
Offset this view's horizontal location by the specified amount of pixels.
Link copied to clipboard
open fun offsetTopAndBottom(@NonNull view: @NonNull View, offset: Int)
Offset this view's vertical location by the specified number of pixels.
Link copied to clipboard
@NonNull
open fun onApplyWindowInsets(@NonNull view: @NonNull View, @NonNull insets: @NonNull WindowInsetsCompat): @NonNull WindowInsetsCompat
Called when the view should apply WindowInsetsCompat according to its internal policy.
Link copied to clipboard
Initializes an AccessibilityEvent with information about this View which is the event source.
Link copied to clipboard
open fun onInitializeAccessibilityNodeInfo(@NonNull v: @NonNull View, @NonNull info: @NonNull AccessibilityNodeInfoCompat)
Initializes an AccessibilityNodeInfoCompat with information about this view.
Link copied to clipboard
Called from dispatchPopulateAccessibilityEvent giving a chance to this View to populate the accessibility event with its text content.
Link copied to clipboard
open fun performAccessibilityAction(@NonNull view: @NonNull View, action: Int, @Nullable arguments: @Nullable Bundle): Boolean
Performs the specified accessibility action on the view.
Link copied to clipboard
open fun performHapticFeedback(@NonNull view: @NonNull View, feedbackConstant: Int): Boolean
open fun performHapticFeedback(@NonNull view: @NonNull View, feedbackConstant: Int, flags: Int): Boolean
Perform a haptic feedback to the user for the view.
Link copied to clipboard
@Nullable
open fun performReceiveContent(@NonNull view: @NonNull View, @NonNull payload: @NonNull ContentInfoCompat): @Nullable ContentInfoCompat
Receives the given content.
Link copied to clipboard
open fun postInvalidateOnAnimation(@NonNull view: @NonNull View)
Cause an invalidate to happen on the next animation time step, typically the next display frame.
open fun postInvalidateOnAnimation(@NonNull view: @NonNull View, left: Int, top: Int, right: Int, bottom: Int)
Cause an invalidate of the specified area to happen on the next animation time step, typically the next display frame.
Link copied to clipboard
open fun postOnAnimation(@NonNull view: @NonNull View, @NonNull action: @NonNull Runnable)
Causes the Runnable to execute on the next animation time step.
Link copied to clipboard
open fun postOnAnimationDelayed(@NonNull view: @NonNull View, @NonNull action: @NonNull Runnable, delayMillis: Long)
Causes the Runnable to execute on the next animation time step, after the specified amount of time elapses.
Link copied to clipboard
open fun removeAccessibilityAction(@NonNull view: @NonNull View, actionId: Int)
Removes an accessibility action that can be performed on a node associated with a view.
Link copied to clipboard
open fun removeOnUnhandledKeyEventListener(@NonNull view: @NonNull View, @NonNull listener: @NonNull ViewCompat.OnUnhandledKeyEventListenerCompat)
Removes a listener which will receive unhandled KeyEvents.
Link copied to clipboard
open fun replaceAccessibilityAction(@NonNull view: @NonNull View, @NonNull replacedAction: @NonNull AccessibilityNodeInfoCompat.AccessibilityActionCompat, @Nullable label: @Nullable CharSequence, @Nullable command: @Nullable AccessibilityViewCommand)
Replaces an action.
Link copied to clipboard
open fun requestApplyInsets(@NonNull view: @NonNull View)
Ask that a new dispatch of View.onApplyWindowInsets(WindowInsets) be performed.
Link copied to clipboard
open fun <T : View?> requireViewById(@NonNull view: @NonNull View, @IdRes id: Int): @NonNull T
Finds the first descendant view with the given ID, the view itself if the ID matches getId, or throws an IllegalArgumentException if the ID is invalid or there is no matching view in the hierarchy.
Link copied to clipboard
open fun resolveSizeAndState(size: Int, measureSpec: Int, childMeasuredState: Int): Int
Utility to reconcile a desired size and state, with constraints imposed by a MeasureSpec.
Link copied to clipboard
open fun restoreDefaultFocus(@NonNull view: @NonNull View): Boolean
Gives focus to the default-focus view in the view hierarchy rooted at view.
Link copied to clipboard
open fun saveAttributeDataForStyleable(@NonNull view: @NonNull View, @NonNull context: @NonNull Context, styleable: @NonNull Array<Int>, @Nullable attrs: @Nullable AttributeSet, @NonNull t: @NonNull TypedArray, defStyleAttr: Int, defStyleRes: Int)
Stores debugging information about attributes.
Link copied to clipboard
open fun setAccessibilityDelegate(@NonNull v: @NonNull View, @Nullable delegate: @Nullable AccessibilityDelegateCompat)
Sets a delegate for implementing accessibility support via composition (as opposed to inheritance).
Link copied to clipboard
open fun setAccessibilityHeading(@NonNull view: @NonNull View, isHeading: Boolean)
Set if view is a heading for a section of content for accessibility purposes.
Link copied to clipboard
open fun setAccessibilityLiveRegion(@NonNull view: @NonNull View, mode: Int)
Sets the live region mode for this view.
Link copied to clipboard
open fun setAccessibilityPaneTitle(@NonNull view: @NonNull View, @Nullable accessibilityPaneTitle: @Nullable CharSequence)
Visually distinct portion of a window with window-like semantics are considered panes for accessibility purposes.
Link copied to clipboard
open fun setActivated(view: View, activated: Boolean)
Changes the activated state of this view.
Link copied to clipboard
open fun setAlpha(view: View, @FloatRange(from = 0.0, to = 1.0) value: Float)
Sets the opacity of the view.
Link copied to clipboard
open fun setAutofillHints(@NonNull view: @NonNull View, autofillHints: @Nullable Array<String>)
Sets the hints that help an android.service.autofill.AutofillService determine how to autofill the view with the user's data.
Link copied to clipboard
open fun setAutofillId(@NonNull v: @NonNull View, @Nullable id: @Nullable AutofillIdCompat)
Sets the unique, logical identifier of this view in the activity, for autofill purposes.
Link copied to clipboard
open fun setBackground(@NonNull view: @NonNull View, @Nullable background: @Nullable Drawable)
Set the background of the view to a given Drawable, or remove the background.
Link copied to clipboard
open fun setBackgroundTintList(@NonNull view: @NonNull View, @Nullable tintList: @Nullable ColorStateList)
Applies a tint to the background drawable.
Link copied to clipboard
open fun setBackgroundTintMode(@NonNull view: @NonNull View, mode: @Nullable PorterDuff.Mode)
Specifies the blending mode used to apply the tint specified by setBackgroundTintList to the background drawable.
Link copied to clipboard
open fun setChildrenDrawingOrderEnabled(viewGroup: ViewGroup, enabled: Boolean)
Tells the ViewGroup whether to draw its children in the order defined by the method ViewGroup.getChildDrawingOrder(int, int).
Link copied to clipboard
open fun setClipBounds(@NonNull view: @NonNull View, @Nullable clipBounds: @Nullable Rect)
Sets a rectangular area on this view to which the view will be clipped when it is drawn.
Link copied to clipboard
open fun setContentCaptureSession(@NonNull v: @NonNull View, @Nullable contentCaptureSession: @Nullable ContentCaptureSessionCompat)
Sets the (optional) ContentCaptureSession associated with this view.
Link copied to clipboard
open fun setElevation(@NonNull view: @NonNull View, elevation: Float)
Link copied to clipboard
open fun setFitsSystemWindows(view: View, fitSystemWindows: Boolean)
Sets whether or not this view should account for system screen decorations such as the status bar and inset its content; that is, controlling whether the default implementation of fitSystemWindows will be executed.
Link copied to clipboard
open fun setFocusedByDefault(@NonNull view: @NonNull View, isFocusedByDefault: Boolean)
Sets whether view should receive focus when the focus is restored for the view hierarchy containing it.
Link copied to clipboard
open fun setHasTransientState(@NonNull view: @NonNull View, hasTransientState: Boolean)
Set whether this view is currently tracking transient state that the framework should attempt to preserve when possible.
Link copied to clipboard
open fun setImportantForAccessibility(@NonNull view: @NonNull View, mode: Int)
Sets how to determine whether this view is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen.
Link copied to clipboard
open fun setImportantForAutofill(@NonNull v: @NonNull View, mode: Int)
Sets the mode for determining whether this view is considered important for autofill.
Link copied to clipboard
open fun setImportantForContentCapture(@NonNull v: @NonNull View, mode: Int)
Sets the mode for determining whether this view is considered important for content capture.
Link copied to clipboard
open fun setKeyboardNavigationCluster(@NonNull view: @NonNull View, isCluster: Boolean)
Set whether view is a root of a keyboard navigation cluster.
Link copied to clipboard
open fun setLabelFor(@NonNull view: @NonNull View, @IdRes labeledId: Int)
Sets the id of a view for which a given view serves as a label for accessibility purposes.
Link copied to clipboard
open fun setLayerPaint(@NonNull view: @NonNull View, @Nullable paint: @Nullable Paint)
Updates the Paint object used with the current layer (used only if the current layer type is not set to LAYER_TYPE_NONE).
Link copied to clipboard
open fun setLayerType(view: View, layerType: Int, paint: Paint)
Specifies the type of layer backing this view.
Link copied to clipboard
open fun setLayoutDirection(@NonNull view: @NonNull View, layoutDirection: Int)
Set the layout direction for this view.
Link copied to clipboard
open fun setNestedScrollingEnabled(@NonNull view: @NonNull View, enabled: Boolean)
Enable or disable nested scrolling for this view.
Link copied to clipboard
open fun setNextClusterForwardId(@NonNull view: @NonNull View, nextClusterForwardId: Int)
Sets the ID of the next keyboard navigation cluster root view.
Link copied to clipboard
open fun setOnApplyWindowInsetsListener(@NonNull view: @NonNull View, @Nullable listener: @Nullable OnApplyWindowInsetsListener)
Set an OnApplyWindowInsetsListener to take over the policy for applying window insets to this view.
Link copied to clipboard
open fun setOnReceiveContentListener(@NonNull view: @NonNull View, mimeTypes: @Nullable Array<String>, @Nullable listener: @Nullable OnReceiveContentListener)
Sets the listener to be used to handle insertion of content into the given view.
Link copied to clipboard
open fun setOverScrollMode(view: View, overScrollMode: Int)
Set the over-scroll mode for this view.
Link copied to clipboard
open fun setPaddingRelative(@NonNull view: @NonNull View, @Px start: Int, @Px top: Int, @Px end: Int, @Px bottom: Int)
Sets the relative padding.
Link copied to clipboard
open fun setPivotX(view: View, value: Float)
Sets the x location of the point around which the view is rotated and scaled.
Link copied to clipboard
open fun setPivotY(view: View, value: Float)
Sets the y location of the point around which the view is rotated and scaled.
Link copied to clipboard
open fun setPointerIcon(@NonNull view: @NonNull View, @Nullable pointerIcon: @Nullable PointerIconCompat)
Set the pointer icon for the current view.
Link copied to clipboard
open fun setRotation(view: View, value: Float)
Sets the degrees that the view is rotated around the pivot point.
Link copied to clipboard
open fun setRotationX(view: View, value: Float)
Sets the degrees that the view is rotated around the horizontal axis through the pivot point.
Link copied to clipboard
open fun setRotationY(view: View, value: Float)
Sets the degrees that the view is rotated around the vertical axis through the pivot point.
Link copied to clipboard
open fun setSaveFromParentEnabled(view: View, enabled: Boolean)
Controls whether the entire hierarchy under this view will save its state when a state saving traversal occurs from its parent.
Link copied to clipboard
open fun setScaleX(view: View, value: Float)
Sets the amount that the view is scaled in x around the pivot point, as a proportion of the view's unscaled width.
Link copied to clipboard
open fun setScaleY(view: View, value: Float)
Sets the amount that the view is scaled in Y around the pivot point, as a proportion of the view's unscaled width.
Link copied to clipboard
open fun setScreenReaderFocusable(@NonNull view: @NonNull View, screenReaderFocusable: Boolean)
Sets whether this View should be a focusable element for screen readers and include non-focusable Views from its subtree when providing feedback.
Link copied to clipboard
open fun setScrollIndicators(@NonNull view: @NonNull View, indicators: Int)
Sets the state of all scroll indicators.
open fun setScrollIndicators(@NonNull view: @NonNull View, indicators: Int, mask: Int)
Sets the state of the scroll indicators specified by the mask.
Link copied to clipboard
open fun setStateDescription(@NonNull view: @NonNull View, @Nullable stateDescription: @Nullable CharSequence)
Sets the state description of this node.
Link copied to clipboard
open fun setSystemGestureExclusionRects(@NonNull view: @NonNull View, @NonNull rects: @NonNull List<Rect>)
Sets a list of areas within this view's post-layout coordinate space where the system should not intercept touch or other pointing device gestures.
Link copied to clipboard
open fun setTooltipText(@NonNull view: @NonNull View, @Nullable tooltipText: @Nullable CharSequence)
Sets the tooltip for the view.
Link copied to clipboard
open fun setTransitionName(@NonNull view: @NonNull View, @Nullable transitionName: @Nullable String)
Sets the name of the View to be used to identify Views in Transitions.
Link copied to clipboard
open fun setTranslationX(view: View, value: Float)
Sets the horizontal location of this view relative to its left position.
Link copied to clipboard
open fun setTranslationY(view: View, value: Float)
Sets the vertical location of this view relative to its top position.
Link copied to clipboard
open fun setTranslationZ(@NonNull view: @NonNull View, translationZ: Float)
Sets the depth location of this view relative to its elevation.
Link copied to clipboard
open fun setWindowInsetsAnimationCallback(@NonNull view: @NonNull View, callback: @Nullable WindowInsetsAnimationCompat.Callback)
Sets a WindowInsetsAnimationCompat.Callback to be notified about animations of windows that cause insets.
Link copied to clipboard
open fun setX(view: View, value: Float)
Sets the visual x position of this view, in pixels.
Link copied to clipboard
open fun setY(view: View, value: Float)
Sets the visual y position of this view, in pixels.
Link copied to clipboard
open fun setZ(@NonNull view: @NonNull View, z: Float)
Sets the visual z position of this view, in pixels.
Link copied to clipboard
open fun startDragAndDrop(@NonNull v: @NonNull View, @Nullable data: @Nullable ClipData, shadowBuilder: @NonNull View.DragShadowBuilder, @Nullable myLocalState: @Nullable Any, flags: Int): Boolean
Start the drag and drop operation.
Link copied to clipboard
open fun startNestedScroll(@NonNull view: @NonNull View, axes: Int): Boolean
open fun startNestedScroll(@NonNull view: @NonNull View, axes: Int, type: Int): Boolean
Begin a nestable scroll operation along the given axes.
Link copied to clipboard
open fun stopNestedScroll(@NonNull view: @NonNull View)
open fun stopNestedScroll(@NonNull view: @NonNull View, type: Int)
Stop a nested scroll in progress.
Link copied to clipboard
open fun transformMatrixToGlobal(@NonNull view: @NonNull View, @NonNull matrix: @NonNull Matrix)
Modifies the input matrix such that it maps on-screen coordinates to view-local coordinates for the provided view.
Link copied to clipboard
open fun updateDragShadow(@NonNull v: @NonNull View, shadowBuilder: @NonNull View.DragShadowBuilder)
Update the drag shadow while drag and drop is in progress.